<?php
require_once 'phpmoko/lib/common.php';

require_once 'phpmoko/ui/Widget.php';

class ScrollPanel extends Widget
{
	/**
	 *
	 * @var Widget
	 */
	private $widget;

	function __construct($widget)
	{
		parent::__construct();
		$this->widget = $widget;
	}

	function toString()
	{
		$str = '<div style="overflow: auto; position: relative;';

		if ($this->getWidth() != null)
			$str .= ' width: ' . $this->getWidth() . ';';

		if ($this->getHeight() != null)
			$str .= ' height: ' . $this->getHeight() . ';';

		$str .= '">';

		$str .= Widget::toStringSafe($this->widget);

		$str .= '</div>';

		return $str;
	}
}
?>